<?php
//error_reporting(E_ERROR);
error_reporting(E_ALL|E_NOTICE);
ini_set('display_errors', 'on');

define('FROM_INDEX', true);
define('ROOT_PATH', substr(dirname(__FILE__), 0, -10).'/');

require ROOT_PATH.'include/lib/load_setting.php';
load_setting('config_global');
@header('Content-Type: text/html; charset='.CHARSET);

require_once ROOT_PATH.'include/logic/image.logic.php';

if ($_FILES["file"]["error"] > 0)
{
	echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
	echo "Upload: " . $_FILES["file"]["name"] . "<br />";
	echo "Type: " . $_FILES["file"]["type"] . "<br />";
	echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
	echo "Stored in: " . $_FILES["file"]["tmp_name"];
	
	$img_name = '/story/test.jpg';
	var_dump(save_to_bcs_from_file($img_name, $_FILES["file"]["tmp_name"]));
}